<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
 	String path = request.getContextPath();
 	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 	request.setAttribute("path", path);
 	request.setAttribute("jsPath", path+"/js");
 	request.setAttribute("cssPath", path+"/css");
 	request.setAttribute("imagePath", path+"/image");
 %>


<!DOCTYPE html>
<html>
<head>
<title>登陆</title>
	<!-- css调用 -->
	  <link rel="stylesheet" href="${cssPath}/bootstrap.min.css" type="text/css"/>
	  <!-- Font Awesome -->
	  <link rel="stylesheet" href="${cssPath}/font-awesome.min.css">
	  <!-- Ionicons -->
	  <link rel="stylesheet" href="${cssPath}/ionicons.min.css">
	  <!-- Theme style -->
	  <link rel="stylesheet" href="${cssPath}/AdminLTE.min.css">
	 
	  <link rel="stylesheet" href="${cssPath}/skin-blue.min.css">
	
	  <!-- Google Font -->
	  <link rel="stylesheet"  href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
	<script type="text/javascript" src="${jsPath}/jquery.min.js"></script>
	<script type="text/javascript" src="${jsPath}/admin/login.js"></script>
	<script type="text/javascript">
		function checkStaffNumAjax(){
			var url="${path}/auth/checkStaffNum";
			var $staffNum=$("input[name=staffNum]");
			var params="staffNum="+$staffNum.val();
			$.post(url,params,function($data){
				var code = $data.code;
				if(code!=1){
					$staffNum.next().next().text("账户不存在！");
					$("input[name=rememberPwd]").prop("checked","");
				}else{
					$staffNum.next().next().text("");
					if($data.message!=null || $data.message==""){
						$("input[name=pwd]").val($data.message);
						$("input[name=rememberPwd]").prop("checked","true");
					}
				}
			},"json");
		}
		
		
		
	
	</script>

</head>

<body class="hold-transition login-page">

<div class="login-box">

 <div class="login-box-body">
    <p class="login-box-msg">权限管理系统</p>
    
    <c:if test="${message!=null}">
			<p class="msg" style="color: red;border:1px solid red;background-color:#FEE1DC;">${message}</p>
	</c:if>
    <form action="${path}/auth/login" method="post" name="myForm">
      <div class="form-group has-feedback">
        <input type="text" class="form-control" name="staffNum" placeholder="请输入账户">
        <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
        <span></span>
      </div>
      <div class="form-group has-feedback">
        <input type="password" class="form-control" name="pwd" placeholder="请输入密码">
        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
       	<span></span>
      </div>
      <div class="row">
        <div class="col-xs-8">
            <label>
              <input type="checkbox" name="rememberPwd"> 记住密码
            </label>
        </div>
        <!-- /.col -->
        <div class="col-xs-4">
          <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
        </div>
        <!-- /.col -->
      </div>
    </form>
  </div>
 </div>
</body>
</html>